/**
 * Copyright (c) 2009 blurredVision
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
 * associated documentation files (the "Software"), to deal in the Software without restriction, 
 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 
 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or 
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 
 * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT 
 * OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#ifndef __IMODEL_H__
#define __IMODEL_H__

#pragma once

#include "sg/SceneNode.h"
#include "IMaterial.h"
#include "ITexture.h"

/**
 * \ingroup CoreEngine
 * 
 * The IModel interface.<br>
 * Handles loading of an DirectX .x model type.<br>
 * This is being replaced by the model::IModelBase interface.
 *
 * \date 04-01-2007
 *
 * \author juckel
 *
 */
class DLL_EXPORT IModel
	: public sg::SceneNode
{
public:

	/// Draws the loaded model
	virtual void draw() = 0;

	/// Updates the loaded model by delta T
	virtual void update(double dt) = 0;

	/// Loads the model from a file
	virtual bool load(const std::string &filename) = 0;

	/// Draws this node and all sub-nodes
	virtual void drawNodes();

	/// Indicates if the model is loaded
	bool isLoaded() const;

	/// Enables the use of materials stored in the model file
	void setUseInternalMaterials(bool value);

	virtual std::string getClassType() const { return "IModel"; }

protected:
	IModel(void);
	virtual ~IModel(void);

	bool m_bLoaded;
	bool m_bUseIntMats;

	unsigned int m_uiNumMaterials;
	unsigned int m_uiNumTextures;

	IMaterial *m_pMaterials;
	ITexture  *m_pTextures;
};

#endif
